import request from "@/utils/request"

// 登录
export function login(data) {
  return request({
    url: "/user/login",
    method: "post",
    data
  })
}

// 获取用户信息和菜单
export function getInfo(userCode) {
  return request({
    url: "/user/queryUserMenu",
    method: "get",
    params: {userCode}
  })
}

// 更新token与exp
export function updateToken() {
  return request({
    url: "/user/updateToken",
    method: "post"
  })
}

// 查询配置登录信息
export function queryLoginInfo(data) {
  return request({
    url: "/user/queryMessageByProjectCode",
    method: "get",
    params: data
  })
}

// 查询顶部数据
export function queryHeadInfo(data) {
  return request({
    url: "/user/queryHeadInfo",
    method: "get",
    params: data
  })
}

export function updateBAccountAndPwd(data) {
  return request({
    url: "/user/updateBAccountAndPwd",
    method: "post",
    data: data
  })
}

export function queryRule(data) {
  return request({
    url: "/allSend/queryRule",
    method: "get",
    params: data
  })
}

export function queryPicLight(data) {
  return request({
    url: "/principalTotal/queryPicLight",
    method: "get",
    params: data
  })
}

export function queryCronList(data) {
  return request({
    url: "/allSend/queryCronList",
    method: "get",
    params: data
  })
}

export function updateRule(data) {
  return request({
    url: "/allSend/updateRule",
    method: "post",
    data: data
  })
}

export function updateRuleV2(data) {
  return request({
    url: "/allSend/updateRuleV2",
    method: "post",
    data: data
  })
}

export function batchControl(data) {
  return request({
    url: "/allSend/batchControl",
    method: "post",
    data: data
  })
}

export function queryItemsList(data) {
  return request({
    url: "/allSend/queryItemsList",
    method: "get",
    params: data
  })
}

export function queryDeviceReportList(data) {
  return request({
    url: "/allSend/queryDeviceReportList",
    method: "get",
    params: data
  })
}

export function countRisk(data) {
  return request({
    url: "/risk/countRisk",
    method: "get",
    params: data
  })
}

export function queryNotMakeList(data) {
  return request({
    url: "/risk/queryNotMakeList",
    method: "get",
    params: data
  })
}

export function countRiskOverPage(data) {
  return request({
    url: "/risk/countRiskOverPage",
    method: "get",
    params: data
  })
}
